/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package action.Administration;

import ConstantInProject.VariableObject;
import Models.*;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import java.util.Map;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;

/**
 *
 * @author trang_000
 */
public class HomeAction extends ActionSupport {
    private User user;
    private Profile profile;

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Profile getProfile() {
        return profile;
    }

    public void setProfile(Profile profile) {
        this.profile = profile;
    }
    

    @Action(value = "home", results = {
        @Result(name = "success", location = "/Administration/HomePage.jsp")
    })
    public String home() {
        return SUCCESS;
    }
    @Action(value = "Mon-Dossieur/Mes-information", results = {
        @Result(name = "success", location = "/Dossieur/MesInformations.jsp")
    })
    
    
    public String getInformation() {  
        Map session = ActionContext.getContext().getSession();
        user = VariableObject.currentUser;
        System.out.println(user.getUserName());
        return SUCCESS;
    }
}
